package com.gitee.wsl.common.ui.symbol

import androidx.compose.ui.graphics.Path
import com.gitee.wsl.common.ui.base.Point
import com.gitee.wsl.mathematics.geometry.shape.Circle

class Pen(var position: Point, var radius: Float = 0.0f)

private const val r_nib = 30f
private const val r_pen = 100f

fun Path.pen(pen: Pen) {
    val x = pen.position.x
    val y = pen.position.y

    circle(Circle(x, y, 3f))

    moveTo(x, y)

    lineTo(x + r_nib, y)

    lineTo(x, y - r_nib)

    lineTo(x, y)

    moveTo(x + r_nib, y)

    lineTo(x + r_nib + r_pen, y - r_pen)

    lineTo(x + r_pen, y - r_pen - r_nib)

    lineTo(x, y - r_nib)
}